package Exercise;
//统计输入字符串中大小写字母的个数和数字的个数
import java.util.Scanner;
public class Count {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String words = sc.next();
        int count1 = 0;  //记录大写字母个数
        int count2 = 0;  //记录小写字母个数
        int count3 = 0;  //记录数字个数
        for (int i = 0; i < words.length(); i++) {
            char word = words.charAt(i);
            //统计大写字母个数
            if(word>='a'&&word<='z'){
                count1++;
            }
            //统计小写字母个数
            else if(word>='A'&&word<='Z'){
                count2++;
            }
            //统计数字的个数
            else if(word>='0'&&word<='9'){
                count3++;
            }
        }
        System.out.println("小写字母的个数为"+count2);
        System.out.println("大写字母的个数为"+count1);
        System.out.println("数字的个数为"+count3);

    }

}
